<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ include file="/base/base.jsp"%>
<%@ include file="/base/database.jsp"%>

	<%
		String leaveID=request.getParameter("leaveID");
	   
		Connection conn=getConn();
		
		String sql="select * from sys_leave where leaveID=?";
		
		PreparedStatement pstmt=conn.prepareStatement(sql);
		
		pstmt.setString(1,leaveID);
		
		ResultSet rs=pstmt.executeQuery();
		
		String rs_leaveID="";
		String rs_courseID="";
		String rs_reason="";
		String rs_daynum="";
		String rs_stuNo="";
		String rs_applytime="";
		String rs_audittime="";
		String rs_opinion="";

		
		if(rs.next()){
			
			rs_leaveID=rs.getString("leaveID");
			rs_courseID=rs.getString("courseID");
			rs_reason=rs.getString("reason");
			rs_daynum=rs.getString("daynum");
			rs_stuNo=rs.getString("stuNo");
			rs_applytime=rs.getString("applytime");
			rs_audittime=rs.getString("audittime");
			rs_opinion=rs.getString("opinion");
	
		}
		
		session.setAttribute("rs_leaveID", rs_leaveID);
		session.setAttribute("rs_courseID",rs_courseID);
		session.setAttribute("rs_reason", rs_reason);
		session.setAttribute("rs_daynum",rs_daynum);
		session.setAttribute("rs_stuNo", rs_stuNo);
		session.setAttribute("rs_applytime", rs_applytime);
		session.setAttribute("rs_audittime",rs_audittime);
		session.setAttribute("rs_opinion",rs_opinion);
		
		if(pstmt!=null){
			pstmt.close();
		}
		if(conn!=null){
			conn.close();
		}
		
		process(request,response,"leave_search.jsp");
		
		%>